<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <!-- <van-swipe-item>1</van-swipe-item>
      <van-swipe-item>2</van-swipe-item>
      <van-swipe-item>3</van-swipe-item>
      <van-swipe-item>4</van-swipe-item> -->
        <van-swipe-item v-for="(item,index) in arr1" :key="index">
          <img :src="item.img" alt="">
        </van-swipe-item>
    </van-swipe>
  
  </div>
</template>

<script>

import Vue from "vue";
import { Swipe, SwipeItem } from "vant";
Vue.use(Swipe);
Vue.use(SwipeItem);

export default {
      props:["arr1"], // 接收父组件传递过来得参数的
      mounted(){ // 页面一加载就执行了
          
          console.log(this);
      }
 
};
</script>

<style scoped>
/* scoped  代表着这个组件得样式不受外面影响 ，关着门在自己家，我不影响别人，别人也影响不了我*/
.my-swipe {
  height: 100px;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  text-align: center;
  background-color: #39a9ed;
}
</style>>
   
